#@layout()
#define nav()
	#@adminNav()
#end
#define main()
	<div class="panel-group" id="accordion">
		<div class="panel panel-info">
			<div class="panel-heading">
				<h2 class="panel-title">
					<a data-toggle="collapse" data-parent="#accordion" 
				   	href="#collapseOne">
						添加公告（点击折叠）
					</a>
				</h2>
			</div>
			<div id="collapseOne" class="panel-collapse collapse in">
				<div class="panel-body">
					<form class="form-horizontal" role="form" method="post" action="/admin/addAnnouncement" enctype="multipart/form-data">
						<div class="form-group">
							<label for="title" class="col-sm-2 control-label">公告标题</label>
								<div class="col-sm-10">
									<input type="text" class="form-control" id="title" name="announcement.title"
				   						placeholder="请输入公告标题">
								</div>
						</div>
						<div class="form-group">
							<label for="content" class="col-sm-2 control-label">公告内容</label>
								<div class="col-sm-10">
									<textarea class="form-control" id="content" rows="20" name="announcement.content"></textarea>
								</div>
						</div>
						<div class="form-group">
							<label for="inputfile" class="col-sm-2 control-label">附件</label>
								<div class="col-sm-10">
									<input type="file" id="inputfile" name="file">
								</div>
						</div>
						<div class="form-group">
						<div class="col-sm-offset-2 col-sm-10">
							<button type="submit" class="btn btn-default">提交</button>
						</div>
					</div>
						
				</div>
					
				</form>
				</div>
			</div>
		</div>
		#for(x : announcementPage.getList())
		<div class="panel panel-primary">
		<div class="panel-heading">
			<h4 class="panel-title">
				<a data-toggle="collapse" data-parent="#accordion" 
				   href="#collapse#(x.id)">
					#(x.title)
				</a>
			</h4>
		</div>
		<div id="collapse#(x.id)" class="panel-collapse collapse">
			<div class="panel-body">
				<font size="4px">#(x.content)</font></br>
				#if(x.file!=null)
					<a href="../file/announcement/#(x.file)" download><font color="blue">点击下载文件：#(x.file)</font></a></br>
				#end
				<form class="form-horizontal" role="form"  action="/admin/deleteAnnouncement">
					<input type="hidden" name="id" value="#(x.id)"></input>
					<button type="submit" class="btn btn-primary">删除此公告</button>
				</form>
			</div>
		</div>
	</div>
	#end
	</div>
	#@paginate(announcementPage.pageNumber,announcementPage.totalPage,"index")

#end